<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('files', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('user_id')->default(0);
            $table->bigInteger('group_id')->default(0);
            $table->string('file_name', 190);
            $table->string('path');
            $table->string('suffix', 20);
            $table->string('type', 50);
            $table->string('storage', 10);
            $table->bigInteger('size')->default(0);
            $table->softDeletes();
            $table->timestamps();
            $table->index('file_name');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('files');
    }
};
